import config from '../config/config';
import request from '../utils/request';

let service = {};

service.querylinMoneyDetail = (param, cb, ca) => {
  param = param || {};

  let requestUrl = config.api.linMoneyDetail;
  request({
    url: requestUrl,
    showLoading: true,
    data: param,
    method: 'GET',
    success: res => {
      cb(res);
    },
    fail: res => {

    },
    complete: res => {
      if (ca && (typeof ca) == 'function') {
        ca(res);
      }
    }
  });
}

service.querylinMoney = (param, cb, ca) => {
  param = param || {};

  let requestUrl = config.api.linMoney;
  request({
    url: requestUrl,
    showLoading: false,
    data: param,
    method: 'GET',
    success: res => {
      cb(res);
    },
    fail: res => {

    },
    complete: res => {
      if (ca && (typeof ca) == 'function') {
        ca(res);
      }
    }
  });
}

service.getordernumber = (param, cb, ca) => {
  param = param || {};

  let requestUrl = config.api.getordernumber;
  request({
    url: requestUrl,
    showLoading: false,
    data: param,
    method: 'GET',
    success: res => {
      cb(res);
    },
    fail: res => {

    },
    complete: res => {
      if (ca && (typeof ca) == 'function') {
        ca(res);
      }
    }
  });
}

service.getcouponnum = (param, cb, ca) => {
  param = param || {};

  let requestUrl = config.api.getcouponnum;
  request({
    url: requestUrl,
    showLoading: false,
    data: param,
    method: 'GET',
    success: res => {
      cb(res);
    },
    fail: res => {

    },
    complete: res => {
      if (ca && (typeof ca) == 'function') {
        ca(res);
      }
    }
  });
}

service.getinfocouponlist = (param, cb, ca) => {
  param = param || {};

  let requestUrl = config.api.getinfocouponlist;
  request({
    url: requestUrl,
    showLoading: false,
    data: param,
    method: 'GET',
    success: res => {
      cb(res);
    },
    fail: res => {

    },
    complete: res => {
      if (ca && (typeof ca) == 'function') {
        ca(res);
      }
    }
  });
}
//贝壳明细
service.conchbill = (param, cb, ca) => {
  param = param || {};

  let requestUrl = config.api.conchbill;
  request({
    url: requestUrl,
    showLoading: false,
    data: param,
    method: 'GET',
    success: res => {
      cb(res);
    },
    fail: res => {

    },
    complete: res => {
      if (ca && (typeof ca) == 'function') {
        ca(res);
      }
    }
  });
}
//查看贝壳数
service.getconch = (param, cb, ca) => {
  param = param || {};

  let requestUrl = config.api.getconch;
  request({
    url: requestUrl,
    showLoading: false,
    data: param,
    method: 'GET',
    success: res => {
      cb(res);
    },
    fail: res => {

    },
    complete: res => {
      if (ca && (typeof ca) == 'function') {
        ca(res);
      }
    }
  });
}

//通过邀请好友签到的头像和数量
service.showshareinfo = (param, cb, ca) => {
  param = param || {};

  let requestUrl = config.api.showshareinfo;
  request({
    url: requestUrl,
    showLoading: false,
    data: param,
    method: 'GET',
    success: res => {
      cb(res);
    },
    fail: res => {

    },
    complete: res => {
      if (ca && (typeof ca) == 'function') {
        ca(res);
      }
    }
  });
}

//检查是否要显示开店通道
service.showcheck = (param, cb, ca) => {
  param = param || {};

  let requestUrl = config.api.showcheck;
  request({
    url: requestUrl,
    showLoading: false,
    data: param,
    method: 'GET',
    success: res => {
      cb(res);
    },
    fail: res => {

    },
    complete: res => {
      if (ca && (typeof ca) == 'function') {
        ca(res);
      }
    }
  });
}












module.exports = service;